<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改用户')" />
	<th:block th:include="include :: select2-css" />
</head>
<body>
    <div class="main-content">
        <form class="form-horizontal" id="form-child-edit" th:object="${child}">
            <input name="id"  type="hidden"  th:field="*{id}" />
            <h4 class="form-header h4">基本信息</h4>
            <div class="row">
            	<div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">姓名：</label>
                        <div class="col-sm-8">
                            <input name="name"  class="form-control" type="text" maxlength="30"  th:field="*{name}" required>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">手机号码：</label>
                        <div class="col-sm-8">
                            <div class="input-group">
                                <input id="phone" name="phone" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" th:field="*{phone}">
                                <span class="input-group-addon"><i class="fa fa-mobile"></i></span>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">性别：</label>
                        <div class="col-sm-8">
                            <select name="sex" class="form-control">
                                <option value="" th:field="*{sex}">请选择</option>
                                <option value="1" th:field="*{sex}">男</option>
                                <option value="0" th:field="*{sex}">女</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">年级：</label>
                        <div class="col-sm-8">
                            <select name="grade" th:with="type=${@dict.getType('child_grade')}" class="form-control">
                                <option value="">请选择</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{grade}"></option>
                            </select>

                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">出生日期：</label>
                        <div class="col-sm-8">
                            <input type="text" class="time-input form-control" id="birthdayStr" placeholder="出生日期" name="birthdayStr"  th:field="*{birthdayStr}"/>
                        </div>
                    </div>
                </div>

                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label is-required">会员状态：</label>
                        <div class="col-sm-8">
                            <select name="isMember" th:with="type=${@dict.getType('member_status')}" class="form-control">
                                <option value="">请选择</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"  th:field="*{isMember}"></option>
                            </select>
                        </div>
                    </div>
                </div>

            </div>
        </form>
    </div>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: select2-js" />
	<script type="text/javascript">
        var prefix = ctx + "business/child";
        
        $("#form-child-edit").validate({
        	onkeyup: false,
        	rules:{

        	},
        	messages: {

            }
        });
        
        function submitHandler() {
	        if ($.validate.form()) {
	        	var data = $("#form-child-edit").serializeArray();
	        	$.operate.saveTab(prefix + "/edit", data);
	        }
	    }

    </script>
</body>
</html>